/*
 * CollisionManager.h
 *
 *  Created on: 02/09/2010
 *      Author: alex
 */

#ifndef COLLISIONMANAGER_H_
#define COLLISIONMANAGER_H_

#include <vector>
#include "objects/GameObject.h"
#include "objects/Player.h"
#include "objects/FireBall.h"


enum CollisorType {
	COLLIDING_PLAYER,
	COLLIDING_FIRE
};


struct CollisionPair {
	CollisionPair(CollisorType type, GameObject* collisor) : type(type), collisor(collisor) {}
	CollisorType type;
	GameObject* collisor;
};


class CollisionManager {

public:

	void add(CollisorType type, GameObject* collider);

	void treatCollisions(unsigned dt);

protected:

	void treatCollision(Player& a, Player& b, unsigned dt);

	void treatCollision(Player& a, FireBall& b, unsigned dt);

	std::vector<CollisionPair> colliders;

};


extern CollisionManager collisionManager;


#endif /* COLLISIONMANAGER_H_ */
